use criterion::{criterion_group, criterion_main, Criterion};
use compare_string::compare_string::{string_equal, string_compare, string_nocase_compare, string_nocase_equal};

fn bench_string_equal(c: &mut Criterion) {
    c.bench_function("compare_string_string_equal", |b| {
        b.iter(|| string_equal("Hello, world!", "Hello, world!"))
    });
}

fn bench_string_compare(c: &mut Criterion) {
    c.bench_function("compare_string_string_compare", |b| {
        b.iter(|| string_compare("Hello, world!", "Hello, world!"))
    });
}

fn bench_string_nocase_compare(c: &mut Criterion) {
    c.bench_function("compare_string_string_nocase_compare", |b| {
        b.iter(|| string_nocase_compare("Hello, world!", "HELLO, WORLD!"))
    });
}

fn bench_string_nocase_equal(c: &mut Criterion) {
    c.bench_function("compare_string_string_nocase_equal", |b| {
        b.iter(|| string_nocase_equal("Hello, world!", "HELLO, WORLD!"))
    });
}

criterion_group!(
    benches,
    bench_string_equal,
    bench_string_compare,
    bench_string_nocase_compare,
    bench_string_nocase_equal
);
criterion_main!(benches);